#include <stdio.h>
#include <unistd.h>

int main()
{
    pid_t pid = fork();
    if(pid == 0)
    {
        while(1)
        {
            sleep(1);
            printf("我是子进程：%d\n", getpid());
        }
    }
    else
    {
        while(1)
        {
            sleep(1);
            printf("我是父进程：%d\n", getpid());
        }
    }
    return 0;
}
